Commit GtkToggleButton fix to HEAD too.
authorAnders Carlsson <andersca@src.gnome.org>
Sat, 2 Dec 2000 18:05:34 +0000 (18:05 +0000)
committerAnders Carlsson <andersca@src.gnome.org>
Sat, 2 Dec 2000 18:05:34 +0000 (18:05 +0000)
ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtktogglebutton.c

index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 49b9f5c17a874f58b7e1a508e252b77b0c10e61d..71f7709b19e6f0d520ae3e9f5852d2ac68dd594e 100644 (file)
@@ -1,3 +1,10 @@
+2000-20-01  Anders Carlsson  <andersca@gnu.org>
+
+       * gtk/gtktogglebutton.c (gtk_toggle_button_draw): Fix bug when
+       a GtkToggleButton is both insensitive and active, it was being
+       drawn by the GtkButton draw handler which doesn't check the
+       state. Now it's calling gtk_toggle_button_paint instead.
+
 2000-11-30  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtktextdisplay.c (gtk_text_layout_draw): don't create
index 5b70c7e04d481b1b1baf9c8432257b98fdb8d9b0..951c3ee65c4e49b97eba7d53eec30aca21549ad0 100644 (file)
@@ -401,11 +401,22 @@ static gint
 gtk_toggle_button_expose (GtkWidget      *widget,
                          GdkEventExpose *event)
 {
-  if (!GTK_WIDGET_NO_WINDOW (widget) &&
-      GTK_WIDGET_CLASS (parent_class)->expose_event)
-    return GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
-  else
-    return FALSE;
+  GtkBin *bin;
+  GdkEventExpose child_event;
+
+  if (GTK_WIDGET_DRAWABLE (widget))
+    {
+      bin = GTK_BIN (widget);
+
+      gtk_toggle_button_paint (widget, &event->area);
+
+      child_event = *event;
+      if (bin->child && GTK_WIDGET_NO_WINDOW (bin->child) &&
+         gtk_widget_intersect (bin->child, &event->area, &child_event.area))
+       gtk_widget_event (bin->child, (GdkEvent*) &child_event);
+    }
+  
+  return TRUE;
 }
 
 static void